package custompackag
import groovy.sql.Sql

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.checkpoint.Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling
import com.kms.katalon.core.testcase.TestCase
import com.kms.katalon.core.testdata.TestData
import com.kms.katalon.core.testobject.TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable

public class customkeyword {
	@Keyword
	def print(){
		pass
	}

	@Keyword
	def get_sql (select_sql){
		//连接数据库
		def connect = Sql.newInstance("jdbc:mysql://218.17.190.66:3306/shangzhan168_test", "root", "rootadmin", "com.mysql.jdbc.Driver")
		//拼接sqd1l 这里业务是通过mobile去查询并返回验证码。
		def sql_code = select_sql
		//取值（firstRow()取第一行值）
		def row = connect.firstRow(sql_code)
		//println "${row}"
		connect.close();
		//返回YZM列内容
		return  row.values()
	}
}
